#include "creaturecard.h"
#include <QDebug>

CreatureCard::CreatureCard(QDomDocument *xmlDefinition) :
    PermanentCard(xmlDefinition)
{
    m_DamageAdditional = 0;
    m_LifeAdditional = 0;

    m_LifePermanent = 0;
    m_DamagePermanent = 0;

    m_PropertiesList << WORD_DAMAGE << WORD_LIFE;

#ifdef TRACE_ON
    qDebug() << "Creature Card creating";
#endif

    convertFromXML(xmlDefinition, m_PropertiesList);
}

int CreatureCard::getDamage()
{
    return m_DamagePermanent + m_DamageAdditional;
}

int CreatureCard::getLife()
{
    return m_LifePermanent + m_LifeAdditional;
}

void CreatureCard::addDamage(int additionalDamage)
{
    m_DamageAdditional += additionalDamage;
}

void CreatureCard::addLife(int additionalLife)
{
    m_LifeAdditional += additionalLife;
}

void CreatureCard::setLife(int value)
{
    m_LifePermanent = value;
}

void CreatureCard::setDamage(int value)
{
    m_DamagePermanent = value;
}

